{include file='common/header'}
{include file='common/nav'}

<link rel="stylesheet" href="{:HOME_ROOT}/css/book.css"/>

<div class="content">

    <div class="list">
        <ul>
            {each name="list" item="val"}
            <li class="item">
                <a href="{:url('Diary/view', ['bid'=>$val['id']])}">
                    <div class="book">
                        <div class="cover">
                            <a href="{:url('Diary/view', ['bid'=>$val['id']])}">
                                <img src="{:WEB_ROOT}{$val.cover}" />
                            </a>
                        </div>
                        <div class="book_line">{$val.name}</div>
                        <div class="book_time">{:date('Y-m-d', $val['time'])}</div>
                    </div>
                </a>
            </li>
            {/each}
        </ul>
    </div>

    <p style="clear: both"></p>

    {if (count($pages) > 1)}
    <div class="page">
        <div class="prev"><a href="{:url('', ['page'=>\extend\Page::prev()], true)}">上页</a></div>
        <ul>
            <each name="pages" item="p" key="key">
            <li><a href="{:url('', ['page'=>$p], true)}">{$p}</a></li>
            </each>
        </ul>
        <div class="next"><a href="{:url('', ['page'=>\extend\Page::next(count($pages))], true)}">下页</a></div>
        <div style="clear: both"></div>
    </div>
    {/if}

    <div class="createBook"><a href="{:url('Diary/create')}">新建日记本</a></div>

</div>

{include file="common/footer"}